package com.mypackage.diary.modle;

// Generated Oct 28, 2014 3:47:35 PM by Hibernate Tools 4.0.0

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Comment generated by hbm2java
 */
@Entity
@Table(name = "Comment")
public class Comment implements java.io.Serializable {

	private int commentId;
	private Diary diary;
	private UserProfile userProfile;
	private Serializable text;
	private boolean isApproved;
	private int parentId;
	private Date created;
	private Date modified;

	public Comment() {
	}

	public Comment(int commentId, Diary diary, UserProfile userProfile,
			Serializable text, boolean isApproved, int parentId, Date created) {
		this.commentId = commentId;
		this.diary = diary;
		this.userProfile = userProfile;
		this.text = text;
		this.isApproved = isApproved;
		this.parentId = parentId;
		this.created = created;
	}

	public Comment(int commentId, Diary diary, UserProfile userProfile,
			Serializable text, boolean isApproved, int parentId, Date created,
			Date modified) {
		this.commentId = commentId;
		this.diary = diary;
		this.userProfile = userProfile;
		this.text = text;
		this.isApproved = isApproved;
		this.parentId = parentId;
		this.created = created;
		this.modified = modified;
	}

	@Id
	@Column(name = "CommentId", unique = true, nullable = false)
	public int getCommentId() {
		return this.commentId;
	}

	public void setCommentId(int commentId) {
		this.commentId = commentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DiaryId", nullable = false)
	public Diary getDiary() {
		return this.diary;
	}

	public void setDiary(Diary diary) {
		this.diary = diary;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "AuthorId", nullable = false)
	public UserProfile getUserProfile() {
		return this.userProfile;
	}

	public void setUserProfile(UserProfile userProfile) {
		this.userProfile = userProfile;
	}

	@Column(name = "Text", nullable = false)
	public Serializable getText() {
		return this.text;
	}

	public void setText(Serializable text) {
		this.text = text;
	}

	@Column(name = "IsApproved", nullable = false)
	public boolean isIsApproved() {
		return this.isApproved;
	}

	public void setIsApproved(boolean isApproved) {
		this.isApproved = isApproved;
	}

	@Column(name = "ParentId", nullable = false)
	public int getParentId() {
		return this.parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "Created", nullable = false, length = 23)
	public Date getCreated() {
		return this.created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "Modified", length = 23)
	public Date getModified() {
		return this.modified;
	}

	public void setModified(Date modified) {
		this.modified = modified;
	}

}
